package com.atguigu.gulimall.product.vo;

import com.atguigu.gulimall.product.entity.SkuImagesEntity;
import com.atguigu.gulimall.product.entity.SkuInfoEntity;
import com.atguigu.gulimall.product.entity.SpuInfoDescEntity;
import lombok.Data;

import java.util.List;

/**
 * 商品详情视图
 *
 * @author DuGuanghan
 * @since 2024-08-12 10:29:32
 */
@Data
public class SkuItemVO {
    /**
     * SKU 信息
     */
    private SkuInfoEntity skuInfo;
    /**
     * SKU 图片信息
     */
    private List<SkuImagesEntity> skuImages;
    /**
     * SPU 描述信息
     */
    private SpuInfoDescEntity spuInfoDesc;
    /**
     * 销售属性
     */
    private List<SkuItemSaleAttrVO> saleAttrs;
    /**
     * 基础属性分组
     */
    private List<SpuItemAttrGroupVO> attrGroups;

    /**
     * 商品详情的销售属性
     *
     * @author DuGuanghan
     * @since 2024-08-12 10:30:21
     */
    @Data
    public static class SkuItemSaleAttrVO {
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIdVO> attrValues;
    }

    /**
     * SPU 基础属性分组
     *
     * @author DuGuanghan
     * @since 2024-08-12 11:39:49
     */
    @Data
    public static class SpuItemAttrGroupVO {
        private String groupName;
        private List<SpuItemAttrVO> attrVos;
    }

    /**
     * SPU 基础属性
     *
     * @author DuGuanghan
     * @since 2024-08-12 11:40:15
     */
    @Data
    public static class SpuItemAttrVO {
        private String attrName;
        private String attrValue;
    }
}
